package xio.ccf_201612;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 201612-2 工资计算 100
 * Created by Xio on 2017/9/6 0006.
 */
public class SalaryQuery {
        public static void main(String[] args){
            Scanner scanner = new Scanner(System.in);
            int t = scanner.nextInt();
            List<Level> levels = new ArrayList<>();
            levels.add(new Level(0.03,0,1500));
            levels.add(new Level(0.1,1500,4500));
            levels.add(new Level(0.2,4500,9000));
            levels.add(new Level(0.25,9000,35000));
            levels.add(new Level(0.3,35000,55000));
            levels.add(new Level(0.35,55000,80000));
            levels.add(new Level(0.45,80000,-1));
            final int START = 3500;


            if (t<=3500){
                System.out.println(t);
                return;
            }
            double s = t;

            for (Level level : levels) {
                if (level.end<0){
                    s = s+(s-START-level.start)*level.tax/(1-level.tax);
                    break;
                }
                if ((s = s+(level.end-level.start)*level.tax)<level.end+START){

                  double  preS=  s - (level.end-level.start)*level.tax;
                    s = preS+(preS-START-level.start)*level.tax/(1-level.tax);
                    break;
                }
            }
            System.out.println((int)s);
        }

       static class Level{
           private double tax;
           private int start;
           private int end;

            public Level(double tax, int start, int end) {
                this.tax = tax;
                this.start = start;
                this.end = end;
            }
        }
}

